package com.bolins.examples.subspringside.mongodb;

import java.util.Map;

import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;

/**
 * MOngodb 工具类
 * 
 * @author liuys
 * 
 */
public class MongoDBUtils {

	public static DBObject mapToDBObj(Map<String, Object> map) {
		DBObject obj = new BasicDBObject();
		obj.putAll(map);
		return obj;
	}

	public static DBObject restrictionsToDBObject(Restrictions rest) {
		DBObject obj = new BasicDBObject();
		obj.putAll(rest.toMap());
		return obj;
	}
}
